package com.urick.statemachine;

/**
 * Design Theories: 状态机上下文默认实现，根据业务参考实现，业务相关上下文
 * <a href=""></a>
 *
 * @author Rick 2023/4/4 18:26
 * Email: rickwork@163.com
 * Wechat: yy3076815642
 * QQ: 3076815642
 * @since 1.0
 */
public class DefaultContext implements IStateContext<String, String> {
    @Override
    public String getState() {
        return currentState;
    }

    @Override
    public String getEvent() {
        return currentEvent;
    }

    @Override
    public DefaultContext setState(String currentState) {
        this.currentState = currentState;
        return this;
    }

    @Override
    public DefaultContext setEvent(String currentEvent) {
        this.currentEvent = currentEvent;
        return this;
    }

    private String currentState;
    private String currentEvent;

    public static DefaultContext ctx() {
        return new DefaultContext();
    }
}
